package lec10.pm;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

public class ExceptionHandlerDemo {
	int f(int n)
	{
		if(n<0)
			throw new IllegalArgumentException();
		return 2;
	}
	public static void main(String[] args) {
		String srcPath = "C:/1.txt";
		String dstPath = "D:/b.txt";
		try {
			Scanner cin = new Scanner(new File(srcPath));
			PrintWriter cout = new PrintWriter(new FileWriter(dstPath));
			while (cin.hasNextLine())
				{
				
				cout.println(cin.nextLine());
				}
			cin.close();
			cout.close();
			System.out.println(args[0]);
		} catch (FileNotFoundException e) {
			// e.printStackTrace();
			System.out.println("FileNotFound!");
		} catch (IOException e) {
			// e.printStackTrace();
			System.out.println("FileNotFound3!");
		}
	}
}
